package com.lanou.beautifulwardrobe.entity.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.beautifulwardrobe.entity.greendao.UsersEntity;
import com.lanou.beautifulwardrobe.entity.greendao.ProductEntity;

import com.lanou.beautifulwardrobe.entity.greendao.UsersEntityDao;
import com.lanou.beautifulwardrobe.entity.greendao.ProductEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig usersEntityDaoConfig;
    private final DaoConfig productEntityDaoConfig;

    private final UsersEntityDao usersEntityDao;
    private final ProductEntityDao productEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        usersEntityDaoConfig = daoConfigMap.get(UsersEntityDao.class).clone();
        usersEntityDaoConfig.initIdentityScope(type);

        productEntityDaoConfig = daoConfigMap.get(ProductEntityDao.class).clone();
        productEntityDaoConfig.initIdentityScope(type);

        usersEntityDao = new UsersEntityDao(usersEntityDaoConfig, this);
        productEntityDao = new ProductEntityDao(productEntityDaoConfig, this);

        registerDao(UsersEntity.class, usersEntityDao);
        registerDao(ProductEntity.class, productEntityDao);
    }
    
    public void clear() {
        usersEntityDaoConfig.getIdentityScope().clear();
        productEntityDaoConfig.getIdentityScope().clear();
    }

    public UsersEntityDao getUsersEntityDao() {
        return usersEntityDao;
    }

    public ProductEntityDao getProductEntityDao() {
        return productEntityDao;
    }

}
